fix(desktop): replace titleBarOverlay with custom caption buttons for RTL support#35387
Open
IlayBacil1999 wants to merge 1 commit into
Open
fix(desktop): replace titleBarOverlay with custom caption buttons for RTL support#35387IlayBacil1999 wants to merge 1 commit into
IlayBacil1999 wants to merge 1 commit into
Conversation
Replaces the OS-rendered titleBarOverlay caption buttons with custom app-rendered buttons that stay on the right side regardless of Windows RTL settings. This fixes the collision between the close/minimize/restore buttons and the opencode titlebar buttons on RTL systems. - Remove titleBarOverlay from window creation (frame: false, hidden titlebar kept) - Add custom minimize/maximize/close buttons in the renderer titlebar - Wire IPC handlers and preload API for window controls - Track maximize state via event forwarding - Remove hardcoded 138px right spacer and titlebar-area-width constraints
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #35388
Type of change
What does this PR do?
On RTL-configured Windows systems, Electron's titleBarOverlay places the minimize/maximize/close buttons on the left side of the titlebar, colliding with opencode's own buttons (menu, sidebar toggle, navigation).
This removes titleBarOverlay and replaces it with custom renderer-side caption buttons that sit in the right-side spacer already reserved for them. The buttons use native Windows 11-style hover effects (grey overlay on minimize/maximize, red on close).
How did you verify your code works?
Tested locally with electron-vite dev on Windows 11. The titlebar renders correctly with 3 caption buttons on the right that respond to hover/click and properly minimize/maximize/close the window.
Screenshots / recordings
issue:

solved:

Checklist